package com.itboye.jigongbao.adpapter

import android.content.Context
import com.itboye.jigongbao.R
import com.itboye.jigongbao.adpapter.baseAdapter.MutiplyCommonAdapter
import com.itboye.jigongbao.adpapter.baseAdapter.ViewHolder
import com.itboye.jigongbao.bean.CitysBean

/**
 * Created by Administrator on 2018/1/12.
 */
class ProvinceAdapter(context: Context, datas: ArrayList<CitysBean>, vararg layoutId: Int) : MutiplyCommonAdapter<CitysBean>(context, datas, layoutId[0]) {
    override fun getItemViewType(position: Int): Int {
        return 0
    }

    override fun getItemPosition(position: Int) {
    }

    override fun convert(holder: ViewHolder?, t: CitysBean?, type: Int, position: Int) {
        when (t!!.type) {
            0 -> {
                //省
                holder!!.setText(R.id.city_name, t!!.province)
            }
            1 -> {
                //市
                holder!!.setText(R.id.city_name, t!!.cityName)
            }
            2 -> {
                //区
                holder!!.setText(R.id.city_name, t!!.areaName)
            }
            else -> {
            }
        }
    }

}